//
//  UserInfo.m
//  KEREN
//
//  Created by MW on 2023/3/14.
//

#import "UserInfo.h"

@implementation UserInfo

+ (instancetype)initWithDictionary:(NSDictionary *)jsonDic{
    UserInfo *model = [[super alloc] init];
    [model setValuesForKeysWithDictionary:jsonDic];
    if(model.picture){
        if([model.picture hasPrefix:@"http"]){
            model.picture  = jsonDic[@"picture"];
        }else{
            model.picture = [NSString stringWithFormat:@"%@%@",BaseimageUrl,model.picture];
        }
        model.picture = [model.picture stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
    }

    return model;
}

-(id)valueForUndefinedKey:(NSString *)key
{
    return nil;
}
-(void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    if([key isEqualToString:@"id"]){
        self.Id  = [value intValue];
    }
    
}
//BaseimageUrl
@end
